package cn.dnui_wwt524.dnuifood_16110100524.model;

import cn.dnui_wwt524.dnuifood_16110100524.iface.FoodIface;
import cn.dnui_wwt524.dnuifood_16110100524.iface.ShopIface;
import cn.dnui_wwt524.dnuifood_16110100524.listener.OnRetrofitListener;
import cn.dnui_wwt524.dnuifood_16110100524.service.FoodInfoService;
import retrofit2.Call;

public class FoodInfoModel extends BaseModel implements FoodIface {
    private FoodInfoService foodInfoService;
    public FoodInfoModel(){
        super();
        foodInfoService=retrofit.create(FoodInfoService.class);
    }
    @Override
    public void getFoodById(String food_id, OnRetrofitListener listener) {
        Call call =foodInfoService.getFoodById(food_id);
        bindCallBack(call,listener,1);
    }

    @Override
    public void getAllCommentsByFood(String food_id, OnRetrofitListener listener) {
        Call call  =  foodInfoService.getAllCommentsByFood(food_id);
        bindCallBack(call,listener,2);
    }

}
